<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
</body>
</html>
<script>
	var arr = [2, 3, 4, 5, 6];
	console.log(arr.length);

arr = [3, 1, 4, 5];
var sum = 0;
for (var i = 0;i < arr.length; i++ ){
	sum += arr[i];
} document.write(sum);

   var min = arr[0];
   var max = arr[0];
   for (var i = 0; i< arr.length; i++){
   	  min = min < arr[i] ? min : arr[i];
   	  max = max > arr[i] ? max : arr[i];
   }
   document.write("最小值:" + min);

   var min = arr[0];
   var max = arr[0];
   for (var i = 0; i < arr.length; i++){
   	    min = min < arr[i] ? min : arr[i];
   	    max = max > arr[i] ? max : arr[i];
   }
      document.write("最大值:" + max);


      arr = [5, 4, 2, 3, 1];
       if (arr[0] > arr[1]) {
       	var temp = arr[0];
       	arr[0] = arr[1];
       	arr[1] = temp;
       }
       console.log(arr);
       

       for (i = 0; i < arr.length-1-0; i++){
       if (arr[i] > arr[i+1]){
       	 var temp = arr[i];
       	 arr[i] = arr[i+1];
       	 arr[i+1] = temp;
       }
   }
         console.log(arr);

        for(var i = 0; i < arr.length - 1; i ++ )


</script>